package com.aia.ann.persistence.sqlmapdao;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.aia.ann.domain.Insu;
import com.aia.ann.domain.InsuExample;
import com.aia.ann.persistence.dao.InsuDAO;

public class InsuDAOImpl extends SqlMapClientDaoSupport implements InsuDAO {
	
	public long mm_avgByExample(InsuExample example) {
		com.cfh.ahead.CountHolder count = (com.cfh.ahead.CountHolder) getSqlMapClientTemplate().queryForObject("ANN_INSU.mm_avgByExample", example);
		return count.getCNT();
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ANN_INSU
     *
     * @ibatorgenerated Mon Jun 18 09:11:41 GMT 2012
     */
    public InsuDAOImpl() {
        super();
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ANN_INSU
     *
     * @ibatorgenerated Mon Jun 18 09:11:41 GMT 2012
     */
    public int countByExample(InsuExample example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("ANN_INSU.ibatorgenerated_countByExample", example);
        return count.intValue();
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ANN_INSU
     *
     * @ibatorgenerated Mon Jun 18 09:11:41 GMT 2012
     */
    public int deleteByExample(InsuExample example) {
        int rows = getSqlMapClientTemplate().delete("ANN_INSU.ibatorgenerated_deleteByExample", example);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ANN_INSU
     *
     * @ibatorgenerated Mon Jun 18 09:11:41 GMT 2012
     */
    public int deleteByPrimaryKey(Long INSU_ID) {
        Insu key = new Insu();
        key.setINSU_ID(INSU_ID);
        int rows = getSqlMapClientTemplate().delete("ANN_INSU.ibatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ANN_INSU
     *
     * @ibatorgenerated Mon Jun 18 09:11:41 GMT 2012
     */
    public void insert(Insu record) {
        getSqlMapClientTemplate().insert("ANN_INSU.ibatorgenerated_insert", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ANN_INSU
     *
     * @ibatorgenerated Mon Jun 18 09:11:41 GMT 2012
     */
    public void insertSelective(Insu record) {
        getSqlMapClientTemplate().insert("ANN_INSU.ibatorgenerated_insertSelective", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ANN_INSU
     *
     * @ibatorgenerated Mon Jun 18 09:11:41 GMT 2012
     */
    public List selectByExample(InsuExample example) {
        List list = getSqlMapClientTemplate().queryForList("ANN_INSU.ibatorgenerated_selectByExample", example);
        return list;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ANN_INSU
     *
     * @ibatorgenerated Mon Jun 18 09:11:41 GMT 2012
     */
    public Insu selectByPrimaryKey(Long INSU_ID) {
        Insu key = new Insu();
        key.setINSU_ID(INSU_ID);
        Insu record = (Insu) getSqlMapClientTemplate().queryForObject("ANN_INSU.ibatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ANN_INSU
     *
     * @ibatorgenerated Mon Jun 18 09:11:41 GMT 2012
     */
    public int updateByExampleSelective(Insu record, InsuExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("ANN_INSU.ibatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ANN_INSU
     *
     * @ibatorgenerated Mon Jun 18 09:11:41 GMT 2012
     */
    public int updateByExample(Insu record, InsuExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("ANN_INSU.ibatorgenerated_updateByExample", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ANN_INSU
     *
     * @ibatorgenerated Mon Jun 18 09:11:41 GMT 2012
     */
    public int updateByPrimaryKeySelective(Insu record) {
        int rows = getSqlMapClientTemplate().update("ANN_INSU.ibatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ANN_INSU
     *
     * @ibatorgenerated Mon Jun 18 09:11:41 GMT 2012
     */
    public int updateByPrimaryKey(Insu record) {
        int rows = getSqlMapClientTemplate().update("ANN_INSU.ibatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    /**
     * This class was generated by Apache iBATIS ibator.
     * This class corresponds to the database table ANN_INSU
     *
     * @ibatorgenerated Mon Jun 18 09:11:41 GMT 2012
     */
    private static class UpdateByExampleParms extends InsuExample {
        private Object record;

        public UpdateByExampleParms(Object record, InsuExample example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}